$(document).ready(function(){

	$("#search-btn").on("click",activeSearch());
	window.url = "";


	$.ajax({
		type: "POST",
		url: "./visualizzaEvento",
		data: {"EVT_ID" : window.location.hash.substring(1) },
		dataType: "xml",

		success: function(data){






			$(data).find('report').each(function() {
				
				var nomeEvento = $(this).find('nome').text();
				var dataInizio = $(this).find('data_inizio').text();
				var dataFine = $(this).find('data_fine').text();
				var bando = $(this).find('bando').text();
				var url = $(this).find('url').text();
				
				$("#nomeevento").val(nomeEvento);
				$("#datainizio").val(dataInizio);
				$("#datafine").val(dataFine);
				$("#bando").val(bando);
				window.url = url;
				
			}); // FINE EACH FUNCTION

			
		}


		

	});
	
	
});


function downloadBando(){
	window.open(window.url);
}


function activeSearch(){
	
	$("li").removeClass("active");	
	$("li#search-btn").addClass("active");
	$("#white-notify").removeClass("white-notify");
}